using System.Collections.Generic;

namespace StackCalc.Instructions
{
	public class BracedExpression : IInstruction
	{
		public BracedExpression(string valueToStore)
		{
			StoredValue = valueToStore;
		}

		public string StoredValue { get; private set; }

		public override string ToString()
		{
			return "[" + StoredValue + "]";
		}

		public void Execute(List<IInstruction> stack, StackEngine stackEngine)
		{
			// push onto stack
			stack.Add(this);
		}

		public string Validate(List<IInstruction> stack)
		{
			// no errors possible
			return string.Empty;
		}
	}
}